﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using QianBuo.Lottery.Web.Models;
using QianBuo.Lottery.Web.Areas.Manage.Models;
using Code.Models;

namespace QianBuo.Lottery.Web.Areas.Manage.Models.Authorization
{
    [Serializable]
    public class IndexModel
    {
        public AuthorityItem[] Authoritys { get; set; }
    }

    [Serializable]
    public class AuthorityItem
    {
        [Required]
        public int ID { get; set; }
        public string Name { get; set; }
        [Required]
        public bool State { get; set; }
        public string Remark { get; set; }
    }

    [Serializable]
    public class RoleModel
    {
        public RoleItemModel[] Roles { get; set; }
    }

    public class EditModel
    {
        [Required]
        public RoleItemModel Role { get; set; }
        public ModelNameValue<int, bool> Auths { get; set; }
    }

    [Serializable]
    public class RoleItemModel
    {
        public int ID { get; set; }
        [Required]
        public string Name { get; set; }
        [Required]
        public RoleState State { get; set; }
        [Required]
        public AuthorityItem[] Authoritys { get; set; }
    }
}